#ifndef BUTTON_H
#define BUTTON_H

#include <QPixmap>
#include <QPoint>
#include <QPainter>

#include "config.h"

namespace Butt {        // 该名字空间负责实现按钮

    class Button {      // Button类是一个按钮
    public:
        Button(QPoint center, Tm::Time& tm, int size =btn_sz, QColor back =btn_clr.real()) : pos{center}, time{tm}, radius{size}, bgc{back} { }
        void draw(QPixmap* dest) const;     // 绘制
        void click(QPointF p);      // 点击
    private:
        QPoint pos;
        Tm::Time& time;
        int radius;
        QColor bgc;
    };

}

#endif // BUTTON_H
